package com.hai.controller;

import com.hai.config.Constant;
import com.hai.pojo.Result;
import com.hai.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Hai on 2018/3/10.
 */
@RestController
@RequestMapping("product")
public class ProductController {
    @Autowired
    ProductService productService;
    @GetMapping(value = "get")
    public Result getProductById(Long id){
        return Result.success(Constant.MessageConfig.MSG_SUCCESS,productService.selectByPrimaryKey(id));
    }
}
